package cn.edu.nit.sys.listener;

import cn.edu.nit.sys.entity.Sys;
import cn.edu.nit.sys.handle.TimerHandler;
import cn.edu.nit.sys.utils.SysRuntimeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @Author xiaobai
 * @Date 2022/8/30 15:37
 * @Version 1.0.0
 */
@Configuration
public class RunListener implements ServletContextListener {

    @Autowired
    private TimerHandler timerHandler;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        timerHandler.getRate();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        ServletContextListener.super.contextDestroyed(sce);
    }
}
